/* 浅色数据看板风格样式 */

/* 全局样式 */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #374151;
    background-color: #f9fafb;
}

/* 导航标签样式 */
.nav-tab {
    color: #6b7280;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tab:hover {
    color: #3b82f6;
}

.nav-tab.active {
    color: #3b82f6;
    background-color: #eff6ff;
    font-weight: 500;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #3b82f6;
}

/* 卡片样式 */
.card-shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 评分选项样式 */
.rating-option {
    transition: all 0.3s ease;
    position: relative;
}

.rating-option.selected {
    border-color: transparent;
    transform: translateY(-2px);
}

.rating-option[data-rating="A+"].selected {
    background-color: #22c55e;
    color: white;
}

.rating-option[data-rating="A+"].selected .text-success {
    color: white;
}

.rating-option[data-rating="A+"].selected .text-gray-600 {
    color: rgba(255, 255, 255, 0.8);
}

.rating-option[data-rating="A"].selected {
    background-color: #3b82f6;
    color: white;
}

.rating-option[data-rating="A"].selected .text-primary {
    color: white;
}

.rating-option[data-rating="A"].selected .text-gray-600 {
    color: rgba(255, 255, 255, 0.8);
}

.rating-option[data-rating="B"].selected {
    background-color: #eab308;
    color: white;
}

.rating-option[data-rating="B"].selected .text-warning {
    color: white;
}

.rating-option[data-rating="B"].selected .text-gray-600 {
    color: rgba(255, 255, 255, 0.8);
}

.rating-option[data-rating="C"].selected {
    background-color: #ef4444;
    color: white;
}

.rating-option[data-rating="C"].selected .text-danger {
    color: white;
}

.rating-option[data-rating="C"].selected .text-gray-600 {
    color: rgba(255, 255, 255, 0.8);
}

/* 编辑模态框中的评分选项 */
.edit-rating-option {
    transition: all 0.3s ease;
    position: relative;
}

.edit-rating-option.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* 自动保存指示器 */
.auto-save-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.auto-save-indicator::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 1.5s infinite;
}

.auto-save-indicator.saving {
    color: #f59e0b;
}

.auto-save-indicator.saved {
    color: #10b981;
}

.auto-save-indicator.saved::before {
    animation: none;
}

/* 月度网格样式 */
.monthly-grid {
    display: grid;
    gap: 1rem;
}

.day-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.day-card.has-data {
    background-color: #f0fdf4; /* 浅绿色背景表示有记录 */
}

.day-card-header {
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-card-content {
    padding: 1rem;
}

.day-card-actions {
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.day-card-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.day-card-btn.view {
    background-color: #3b82f6;
    color: white;
}

.day-card-btn.view:hover {
    background-color: #2563eb;
}

.day-card-btn.edit {
    background-color: #f59e0b;
    color: white;
}

.day-card-btn.edit:hover {
    background-color: #d97706;
}

/* 历史记录模态框样式 */
.history-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.history-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.history-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-item h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #3b82f6;
    border-radius: 2px;
}

.history-item p {
    color: #6b7280;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .monthly-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-tab {
        width: 100%;
        text-align: center;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-display {
        margin-top: 1rem;
    }
}

/* 折线装饰 */
.polyline-decoration {
    position: relative;
}

.polyline-decoration::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 4px;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='0,2 20,0 40,4 60,0 80,4 100,2' fill='none' stroke='%233b82f6' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 100px 4px;
}

/* 数据强调样式 */
.data-highlight {
    position: relative;
    display: inline-block;
}

.data-highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(59, 130, 246, 0.2);
    z-index: -1;
}

/* 状态颜色 */
.status-up {
    color: #10b981;
}

.status-down {
    color: #ef4444;
}

.status-neutral {
    color: #6b7280;
}

/* 图表容器样式 */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 隐藏文本框滚动条 */
#planInput,
#recordInput,
#summaryInput,
#editPlanInput,
#editRecordInput,
#editSummaryInput {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#planInput::-webkit-scrollbar,
#recordInput::-webkit-scrollbar,
#summaryInput::-webkit-scrollbar,
#editPlanInput::-webkit-scrollbar,
#editRecordInput::-webkit-scrollbar,
#editSummaryInput::-webkit-scrollbar {
    display: none;
}

/* 输入框焦点样式 */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* 按钮点击效果 */
button:active {
    transform: translateY(1px);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #374151;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 卡片切角效果 */
.clip-path-polygon {
    clip-path: polygon(
        0% 0%, 
        95% 0%, 
        100% 5%, 
        100% 100%, 
        5% 100%, 
        0% 95%
    );
}