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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

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

.nav-btn {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.nav-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.main {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 500px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.view-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.back-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.notes-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.sort-icon {
    font-weight: bold;
    font-size: 16px;
}

.sort-text {
    font-weight: 500;
}

.tags-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.tag-item {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.tag-item:hover {
    border-color: #3498db;
    background: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.tag-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.tag-count {
    font-size: 14px;
    color: #7f8c8d;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.note-item {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.note-item:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.note-content {
    color: #2c3e50;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.note-time {
    font-size: 12px;
    color: #95a5a6;
}

.delete-btn {
    padding: 4px 8px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.delete-btn:hover {
    background: #c0392b;
    opacity: 1;
    transform: scale(1.05);
}

.expand-btn {
    padding: 4px 8px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px 0;
    align-self: flex-start;
}

.expand-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.note-content.expandable {
    position: relative;
}

.note-content.expanded {
    max-height: none;
}

.note-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.datetime-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.datetime-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.datetime-container label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.datetime-input {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    flex: 1;
}

.datetime-input:focus {
    outline: none;
    border-color: #3498db;
}

.clear-btn {
    padding: 8px 16px;
    background: #ecf0f1;
    color: #7f8c8d;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.clear-btn:hover {
    background: #d5dbdb;
    color: #5d6d7e;
}

#note-content, #edit-note-content {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#note-content:focus, #edit-note-content:focus {
    outline: none;
    border-color: #3498db;
}

.submit-btn {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    background: #2980b9;
}

.submit-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shortcut-hint, .shortcut-hint-edit {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.note-actions {
    display: flex;
    gap: 8px;
}

.edit-btn {
    padding: 6px 12px;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.edit-btn:hover {
    background: #e67e22;
}

.cancel-btn {
    padding: 12px 24px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cancel-btn:hover {
    background: #7f8c8d;
}

.textarea-container {
    position: relative;
    width: 100%;
}

.tag-suggestions {
    position: absolute;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    min-width: 250px;
    overflow-y: auto;
}

.tag-suggestions.hidden {
    display: none;
}

.tag-suggestions-header {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}

.tag-suggestions-list {
    max-height: 160px;
    overflow-y: auto;
}

.tag-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

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

.tag-suggestion-item:hover,
.tag-suggestion-item.active {
    background: #e3f2fd;
}

.tag-suggestion-name {
    font-weight: 500;
    color: #2c3e50;
}

.tag-suggestion-count {
    font-size: 12px;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 回顾页面样式 */
.review-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-btn {
    padding: 6px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.refresh-btn:hover {
    background: #2980b9;
}

.review-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.review-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 20px;
    min-height: 400px;
}

.review-loading,
.review-empty {
    text-align: center;
    color: #7f8c8d;
}

.loading-text,
.empty-text {
    font-size: 18px;
    font-style: italic;
}

.review-note {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.review-note-content {
    font-size: 18px;
    line-height: 1.8;
    color: #2c3e50;
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.review-note-time {
    font-size: 14px;
    color: #95a5a6;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.review-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-arrow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.nav-arrow:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
}

.nav-arrow:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.nav-text {
    font-weight: 500;
}

.review-tips {
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
    padding: 40px 20px;
}

.login-header {
    margin-bottom: 40px;
}

.login-title {
    font-size: 48px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.login-subtitle {
    font-size: 18px;
    color: #7f8c8d;
    font-weight: 400;
}

.login-content {
    max-width: 400px;
    width: 100%;
}

.login-description {
    margin-bottom: 30px;
}

.login-description p {
    font-size: 16px;
    color: #5d6d7e;
    line-height: 1.6;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.signin-button {
    width: 280px;
    height: 44px;
}

.login-tips {
    margin-top: 20px;
}

.login-tips p {
    font-size: 14px;
    color: #95a5a6;
    font-style: italic;
}

.login-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-loading p {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
}

.logout-btn {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#search-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #3498db;
}

#search-btn {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#search-btn:hover {
    background: #2980b9;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
    font-style: italic;
}

.search-placeholder {
    text-align: center;
    color: #95a5a6;
    padding: 40px;
    font-style: italic;
}

.error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success {
    background: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* 加载更多按钮样式 */
.load-more-container {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
}

.load-more-btn {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.load-more-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
}

.loading-more::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 日历样式 */
.calendar-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.year-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.year-nav-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.year-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.current-year {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    min-width: 60px;
    text-align: center;
}

.calendar-stats {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.calendar-container {
    margin-top: 20px;
}

.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #7f8c8d;
}

.legend-squares {
    display: flex;
    gap: 2px;
}

.legend-square {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-square.level-0 {
    background: #ebedf0;
}

.legend-square.level-1 {
    background: #c6e48b;
}

.legend-square.level-2 {
    background: #7bc96f;
}

.legend-square.level-3 {
    background: #239a3b;
}

.legend-square.level-4 {
    background: #196127;
}

.calendar-months {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.calendar-month {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
}

.month-label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    text-align: center;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.week-day {
    font-size: 10px;
    color: #7f8c8d;
    text-align: center;
    padding: 2px;
    font-weight: 600;
}

.calendar-day {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    margin: 1px;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.level-0 {
    background: #ebedf0;
}

.calendar-day.level-1 {
    background: #c6e48b;
}

.calendar-day.level-2 {
    background: #7bc96f;
}

.calendar-day.level-3 {
    background: #239a3b;
}

.calendar-day.level-4 {
    background: #196127;
}

.calendar-day:not(.empty):hover {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.calendar-day.clickable {
    cursor: pointer;
    position: relative;
}

.calendar-day.clickable:hover {
    transform: scale(1.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    border: 1px solid #3498db;
}

.calendar-day.clickable::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 3px;
    height: 3px;
    background: #2980b9;
    border-radius: 50%;
}

.day-number {
    display: none;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 15px;
    }
    
    .main {
        padding: 15px;
    }
    
    .nav {
        justify-content: center;
    }
    
    .nav-btn {
        flex: 1;
        text-align: center;
        min-width: 70px;
    }
    
    .tags-list {
        grid-template-columns: 1fr;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .calendar-months {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .calendar-controls {
        gap: 10px;
    }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #e9ecef;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #dc3545;
    color: white;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.date-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

.date-notes-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.date-note-item {
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.date-note-item:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.date-note-content {
    color: #2c3e50;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.date-note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
}

.date-note-time {
    font-weight: 500;
}

.date-note-tags {
    display: flex;
    gap: 6px;
}

.date-note-tag {
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.date-note-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.date-note-edit {
    padding: 4px 8px;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.date-note-edit:hover {
    background: #e67e22;
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .date-stats {
        flex-direction: column;
        gap: 8px;
    }
}