/* CRON表达式计算器样式 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 主容器 */
.cron-calculator-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部英雄区域 */
.cron-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* 英雄区域背景效果 */
.cron-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
    z-index: 0;
}

/* 英雄区域内容 */
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 英雄标题 */
.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 英雄副标题 */
.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* 英雄特性 */
.hero-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 50px;
    animation: fadeInUp 1s ease-out 0.4s both;
}

/* 特性项 */
.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 140px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 特性项悬停 */
.feature-item:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 特性图标 */
.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

/* 容器 */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
}

/* 通用部分样式 */
.cron-input-section,
.cron-generator-section,
.cron-result-section,
.cron-examples-section,
.cron-docs-section,
.cron-main-section {
    padding: 80px 0;
    position: relative;
    width: 100%;
}

/* 主功能区域 */
.cron-main-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    padding: 20px 0;
}

/* 主内容布局 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 生成器面板 */
.generator-panel {
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    border-bottom: none;
    padding: 20px;
    margin: 0;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* 输入区域 */
.input-section {
    background: white;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    border-top: none;
    border-bottom: none;
    padding: 20px;
    margin: 0;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* 结果区域 */
.result-section {
    background: white;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    border-top: none;
    padding: 20px;
    margin: 0;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* 面板头部 */
.panel-header {
    margin-bottom: 15px;
}

.panel-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.panel-header p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* 输入区域 */
.cron-input-section {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 生成器区域 */
.cron-generator-section {
    background-color: #f8f9fa;
}

/* 结果区域 */
.cron-result-section {
    background-color: white;
}

/* 示例区域 */
.cron-examples-section {
    background-color: #f8f9fa;
}

/* 文档区域 */
.cron-docs-section {
    background-color: white;
    padding-bottom: 100px;
}

/* 区域标题 */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

/* 区域主标题 */
.section-header h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
    position: relative;
    display: inline-block;
    animation: fadeInUp 0.8s ease-out;
}

/* 区域主标题下划线 */
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    animation: fadeIn 1s ease-out 0.3s both;
}

/* 区域副标题 */
.section-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* 输入包装 */
.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* 输入组 */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 输入标签 */
.input-group label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

/* 输入字段 */
.input-field {
    position: relative;
}

/* 输入框 */
.input-field input {
    width: 100%;
    padding: 20px 25px;
    font-size: 1.1rem;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    background-color: #fafafa;
}

/* 输入框焦点 */
.input-field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background-color: white;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    font-family: inherit;
}

/* 按钮图标 */
.btn-icon {
    font-size: 1rem;
}

/* 主要按钮 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 主要按钮悬停 */
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* 次要按钮 */
.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 次要按钮悬停 */
.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #d0d0d0;
    background-color: #f8f8f8;
}

/* 生成器表单 */
.generator-form {
    max-width: 100%;
    margin: 40px auto 0;
    padding: 40px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.generator-form h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.generator-form p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 表单标签 */
.form-group label {
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

/* 选择框 */
.form-control {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
    cursor: pointer;
}

/* 选择框焦点 */
.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background-color: white;
}

/* 生成器操作 */
.generator-action {
    text-align: center;
}

/* 结果内容 */
.result-content {
    max-width: 100%;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
}

/* 整体描述 */
.overall-description {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    color: white;
}

.overall-description h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.overall-description p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.overall-description code {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: white;
    margin: 0 5px;
    font-weight: 600;
}

/* 下次执行时间 */
.next-runs {
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* 下次执行时间标题 */
.next-runs h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
}

/* 执行表格包装 */
.execution-table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* 执行表格 */
.execution-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
}

/* 表格头部 */
.execution-table th {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 18px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

/* 表格单元格 */
.execution-table td {
    padding: 18px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
    font-size: 0.95rem;
}

/* 表格行悬停 */
.execution-table tr:hover td {
    background-color: #fff5f5;
}

/* 表格行最后一个单元格 */
.execution-table tr:last-child td {
    border-bottom: none;
}

/* 字段结果 */
.field-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

/* 字段结果项 */
.field-result-item {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.15);
    transition: all 0.3s ease;
    border-top: 4px solid #ff6b6b;
    border: 1px solid #ffe0e0;
    position: relative;
    overflow: hidden;
}

/* 字段结果项悬停 */
.field-result-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
}

/* 字段标题 */
.field-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 字段值 */
.field-value {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #ffe8e8 0%, #fff5f5 100%);
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
    box-shadow: inset 0 2px 4px rgba(255, 107, 107, 0.1);
}

/* 字段描述 */
.field-description {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    font-weight: 500;
}

/* 示例网格 */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

/* 示例卡片 */
.example-card {
    background-color: white;
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    animation: fadeInUp 0.8s ease-out calc(var(--index, 0) * 0.1s + 0.3s) both;
}

/* 示例卡片悬停 */
.example-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

/* 示例表达式 */
.example-expression {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding: 15px 20px;
    background-color: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

/* 示例描述 */
.example-desc {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 1rem;
}

/* 示例徽章 */
.example-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* 传统格式徽章 */
.example-badge[data-type="traditional"] {
    background-color: #e8f5e8;
    color: #2e7d32;
}

/* Quartz格式徽章 */
.example-badge[data-type="quartz"] {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* 高级格式徽章 */
.example-badge[data-type="advanced"] {
    background-color: #fce4ec;
    color: #c2185b;
}

/* 文档内容 */
.docs-content {
    margin-top: 50px;
}

/* 文档网格 */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 35px;
}

/* 文档卡片 */
.docs-card {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    animation: fadeInUp 0.8s ease-out calc(var(--index, 0) * 0.1s + 0.3s) both;
}

/* 文档卡片悬停 */
.docs-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

/* 文档卡片标题 */
.docs-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

/* 文档卡片列表 */
.docs-card ul {
    list-style-type: none;
    space-y: 15px;
}

/* 文档卡片列表项 */
.docs-card li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 文档卡片列表项悬停 */
.docs-card li:hover {
    color: #667eea;
    transform: translateX(8px);
}

/* 文档卡片列表项伪元素 */
.docs-card li::before {
    content: '•';
    color: #667eea;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 2px;
    flex-shrink: 0;
}

/* 验证结果 */
.validation-result {
    margin-top: 20px;
    padding: 20px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    animation: fadeIn 0.5s ease-out;
    border-left: 4px solid;
}

/* 错误消息 */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
    box-shadow: 0 2px 10px rgba(244, 67, 54, 0.1);
}

/* 成功消息 */
.success-message {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left-color: #4caf50;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.1);
}

/* 代码样式 */
code {
    background-color: #f5f5f5;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #d32f2f;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 20px;
    text-align: center;
}

.loading p {
    font-size: 1.2rem;
    color: #666;
    margin-top: 20px;
}

.loading::before {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 页脚 */
.cron-footer {
    background-color: #333;
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 80px;
}

.cron-footer .container {
    max-width: 1200px;
}

.cron-footer p {
    margin-bottom: 10px;
    opacity: 0.8;
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 英雄标题 */
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* 英雄特性 */
    .hero-features {
        gap: 20px;
    }
    
    /* 特性项 */
    .feature-item {
        min-width: 120px;
        padding: 20px;
    }
    
    /* 通用部分间距 */
    .cron-input-section,
    .cron-generator-section,
    .cron-result-section,
    .cron-examples-section,
    .cron-docs-section {
        padding: 60px 0;
    }
    
    /* 主内容布局 */
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 15px;
    }
    
    /* 面板调整 */
    .generator-panel,
    .input-section,
    .result-section {
        padding: 20px;
    }
    
    /* 表单行调整 */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    /* 表单组调整 */
    .form-group {
        width: 100%;
    }
    
    /* 按钮组调整 */
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 按钮调整 */
    .action-buttons button {
        width: 100%;
        text-align: center;
    }
    
    /* 区域标题 */
    .section-header h2 {
        font-size: 2.2rem;
    }
    
    /* 操作按钮 */
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    /* 按钮 */
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
        padding: 15px 20px;
    }
    
    /* 表单行 */
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 生成器表单 */
    .generator-form {
        padding: 30px;
    }
    
    /* 示例网格 */
    .examples-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 文档网格 */
    .docs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 字段结果 */
    .field-results {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 执行表格 */
    .execution-table th,
    .execution-table td {
        padding: 12px;
        font-size: 0.85rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

/* 滚动条轨道 */
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

/* 滚动条滑块 */
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* 滚动条滑块悬停 */
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 复制按钮 */
.copy-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #667eea;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.copy-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.copy-button.copied {
    color: #4caf50;
    background-color: #e8f5e8;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选择文本样式 */
::selection {
    background-color: #667eea;
    color: white;
}

/* 打印样式 */
@media print {
    .cron-hero,
    .action-buttons {
        display: none;
    }
    
    .cron-input-section,
    .cron-generator-section,
    .cron-result-section,
    .cron-examples-section,
    .cron-docs-section {
        padding: 20px 0;
    }
    
    .example-card,
    .docs-card,
    .field-result-item {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
