/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* CSS变量定义 */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --transition: all 0.2s ease-in-out;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

/* 头部样式 */
header {
    grid-column: 1 / -1;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-title {
    text-align: center;
    flex: 1;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 语言切换按钮 */
.language-switcher {
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-btn,
.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.action-btn:hover,
.lang-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn:active,
.lang-btn:active {
    transform: translateY(0);
}

.action-btn.enabled {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.action-btn.enabled:hover {
    background: #059669;
    border-color: #059669;
}

.action-btn.disabled {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    opacity: 0.7;
}

.action-btn.disabled:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.action-icon,
.lang-icon {
    font-size: 1.2rem;
}

#currentLangText,
#notificationStatus {
    font-size: 0.9rem;
}

/* 主要内容区域 */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 卡片样式 */
.add-reminder-section,
.reminders-section,
.stats-panel {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* 表单样式 */
.reminder-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

input, textarea, select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--surface-color);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-icon {
    font-size: 1.1em;
}

/* 提醒列表样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-controls {
    display: flex;
    gap: 12px;
}

.filter-controls select {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reminder-item {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
    position: relative;
}

.reminder-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.reminder-item.completed {
    opacity: 0.7;
    background: #f9fafb;
}

.reminder-item.completed .reminder-title {
    text-decoration: line-through;
}

.reminder-item.priority-high {
    border-left: 4px solid var(--danger-color);
}

.reminder-item.priority-medium {
    border-left: 4px solid var(--warning-color);
}

.reminder-item.priority-low {
    border-left: 4px solid var(--success-color);
}

.reminder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.reminder-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.reminder-datetime {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.reminder-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.reminder-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.priority-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high {
    background: #fef2f2;
    color: var(--danger-color);
}

.priority-medium {
    background: #fffbeb;
    color: var(--warning-color);
}

.priority-low {
    background: #f0fdf4;
    color: var(--success-color);
}

.reminder-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* 统计面板样式 */
.stats-panel h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.modal-content .reminder-form {
    padding: 24px;
}

/* 帮助模态框样式 */
.help-content {
    padding: 24px;
}

.help-intro {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #92400e;
    font-weight: 500;
}

.help-section {
    margin-bottom: 24px;
}

.help-section h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.help-section ol {
    margin-left: 20px;
    line-height: 1.8;
}

.help-section li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.help-section strong {
    color: var(--primary-color);
    font-weight: 600;
}

.help-tip {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    margin-top: 20px;
    border-radius: 4px;
    color: #1e40af;
}

.help-tip strong {
    color: #1e3a8a;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* 通知横幅样式 */
.notification-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
}

.notification-banner.show {
    transform: translateY(0);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-icon {
    font-size: 1.5rem;
}

.banner-text {
    flex: 1;
}

.banner-text strong {
    display: block;
    margin-bottom: 4px;
}

.banner-text p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.banner-actions {
    display: flex;
    gap: 12px;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .header-title {
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .action-btn,
    .lang-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls {
        justify-content: stretch;
    }
    
    .filter-controls select {
        flex: 1;
    }
    
    .reminder-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .reminder-meta {
        flex-direction: column;
        align-items: stretch;
    }
    
    .reminder-actions {
        justify-content: center;
    }
    
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .banner-actions {
        justify-content: center;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        flex-direction: row;
    }
    
    .stat-item {
        flex: 1;
    }
}

/* 打印样式 */
@media print {
    .add-reminder-section,
    .stats-panel,
    .reminder-actions,
    .notification-banner {
        display: none;
    }
    
    .container {
        grid-template-columns: 1fr;
    }
    
    .reminder-item {
        break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 16px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #333;
    }
    
    .reminder-item {
        border-width: 2px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}