/* Global base styles */
:root, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #0f0f0f;
  background-color: #f6f6f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* Container for centering login components */
.container {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f5f5;
}

/* Prevent modal scroll issues */
body.modal-open {
  overflow: hidden;
}

/* ==================== public pagination styles ==================== */
/* Pagination styles - public styles, used by all pages */
.pagination-top,
.pagination-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination-top {
    margin-bottom: 20px;
}

.pagination-bottom {
    margin-top: 30px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.pagination-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
    color: #6c757d;
}

.pagination-info {
    margin: 0 15px;
    font-size: 0.9em;
    color: #666;
}

/* Page number buttons */
.page-numbers {
    display: flex;
    gap: 5px;
    margin: 0 10px;
}

.page-number-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
}

.page-number-btn.current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-number-btn:hover:not(.current) {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* 分页响应式设计 */
@media (max-width: 480px) {
    .pagination-top,
    .pagination-bottom {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pagination-info {
        margin: 0 8px;
        font-size: 0.8em;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .page-number-btn {
        padding: 5px 8px;
        font-size: 13px;
    }
}

/* ==================== public refresh button styles ==================== */
/* Refresh button - public styles, used by all pages */
.refresh-btn {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.refresh-btn:hover:not(:disabled) {
    background: #218838;
}

.refresh-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Refresh button responsive design */
@media (max-width: 480px) {
    .refresh-btn {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* ==================== public loading and empty state styles ==================== */
/* Loading state - public styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

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

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

.loading-text {
    color: #666;
    margin: 0;
}

/* Empty state - public styles */
.empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

.empty-message {
    color: #888;
    font-style: italic;
}

/* Records container - public styles */
.records-container {
    margin-top: 2rem;
}

/* ==================== public error handling styles ==================== */
/* Error container and messages - public styles */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.error-message {
    color: #dc3545;
    margin-bottom: 1rem;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 0;
}

.error-message.success {
    color: #28a745;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.error-message.warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
}

.error-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.error-message:not(:empty) {
    display: block;
    margin-bottom: 1rem;
}

.error-message:empty {
    display: none;
}

.retry-button {
    background-color: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.retry-button:hover {
    background-color: #0056b3;
}

/* ==================== public warning messages styles ==================== */
/* No-profile warning - public styles */
.no-profile-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 8px;
}

.no-profile-warning p {
    margin: 0;
    font-size: 14px;
}

/* ==================== public memo cards container styles ==================== */
/* Memo cards container - public styles */
.memo-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 16px;
    margin-top: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    .memo-cards {
        justify-content: center;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .memo-cards {
        gap: 8px;
    }
}

/* ==================== public header section styles ==================== */
/* Header section - public styles */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-section h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* header section responsive design */
@media (max-width: 480px) {
    .header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-section h2 {
        font-size: 1.5rem;
    }
    
    .refresh-btn {
        align-self: flex-end;
    }
}

/* ==================== global modal styles ==================== */
/* Modal styles - public styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 20px 24px;
} 