/* IOT 邮箱模拟器样式 - 清爽干净风格 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    padding: 24px;
    color: #1e293b;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #0f172a;
    padding: 32px 24px;
    background: #ffffff;
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    letter-spacing: -0.025em;
}

h2 {
    color: #0f172a;
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

h2::before {
    content: "📦";
    font-size: 1.125rem;
}

/* 面板样式 */
.control-panel,
.notification-panel,
.log-panel {
    margin: 24px;
    padding: 24px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.control-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

/* 控制面板样式 */
.button-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.interval-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.interval-input label {
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    font-size: 0.875rem;
}

.interval-input input {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 80px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.interval-input input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 按钮样式 */
button {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

#startMonitoring {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

#startMonitoring:hover {
    background: #059669;
    border-color: #059669;
}

#stopMonitoring {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

#stopMonitoring:hover {
    background: #dc2626;
    border-color: #dc2626;
}

#resetLog {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

#resetLog:hover {
    background: #d97706;
    border-color: #d97706;
}

button:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

/* 通知面板样式 - 生动有趣 */
#notificationPanel {
    min-height: 100px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

#notificationPanel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #06b6d4, #8b5cf6, #f59e0b);
    animation: rainbow 3s ease-in-out infinite;
}

@keyframes rainbow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.notification-entry {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #e0f2fe;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
    position: relative;
    transition: all 0.3s ease;
}

.notification-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25);
    border-color: #0ea5e9;
}

.notification-entry::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #0ea5e9, #06b6d4);
    border-radius: 2px 0 0 2px;
}

.notification-timestamp {
    color: #0369a1;
    font-weight: 600;
    margin-right: 16px;
    font-size: 0.75rem;
    min-width: 70px;
    background: #e0f2fe;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

.notification-info {
    color: #0c4a6e;
    font-weight: 600;
    flex: 1;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(14, 165, 233, 0.1);
}

/* 日志面板样式 - 终端风格 */
#logPanel {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 16px;
    background: #0f172a;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.log-entry {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    border-bottom: 1px solid #1e293b;
    transition: background-color 0.15s ease;
}

.log-entry:hover {
    background-color: rgba(34, 197, 94, 0.1);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: #94a3b8;
    font-weight: 500;
    margin-right: 12px;
    min-width: 80px;
    font-size: 0.75rem;
}

.log-info {
    color: #22c55e;
    flex: 1;
    word-break: break-word;
    font-size: 0.75rem;
    text-shadow: 0 0 2px rgba(34, 197, 94, 0.3);
}

/* 滚动条样式 */
#logPanel::-webkit-scrollbar {
    width: 6px;
}

#logPanel::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 3px;
}

#logPanel::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

#logPanel::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    h1 {
        font-size: 1.75rem;
        padding: 24px 20px;
    }
    
    .control-panel,
    .notification-panel,
    .log-panel {
        margin: 16px;
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .interval-input {
        justify-content: center;
    }
    
    button {
        width: 100%;
    }
    
    #logPanel {
        height: 250px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    h1 {
        font-size: 1.5rem;
        padding: 20px 16px;
    }
    
    h2 {
        font-size: 1.125rem;
    }
    
    .control-panel,
    .notification-panel,
    .log-panel {
        margin: 12px;
        padding: 16px;
    }
    
    .notification-entry,
    .log-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .notification-timestamp,
    .log-timestamp {
        margin-right: 0;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-entry,
.log-entry {
    animation: fadeIn 0.2s ease-out;
}

/* 特殊状态样式 */
.notification-entry.door-open {
    border-color: #f87171;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.2);
}

.notification-entry.door-open::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.notification-entry.door-closed {
    border-color: #34d399;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2);
}

.notification-entry.door-closed::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.log-entry.log-success {
    color: #4ade80;
    text-shadow: 0 0 3px rgba(74, 222, 128, 0.4);
}

.log-entry.log-error {
    color: #f87171;
    text-shadow: 0 0 3px rgba(248, 113, 113, 0.4);
}

.log-entry.log-warning {
    color: #fbbf24;
    text-shadow: 0 0 3px rgba(251, 191, 36, 0.4);
}

.log-entry.log-info {
    color: #60a5fa;
    text-shadow: 0 0 3px rgba(96, 165, 250, 0.4);
}
