/* ========================================
   Cron 表达式工具样式
   ======================================== */

/* 主内容 */
.main-content { 
    width: 100%; 
    max-width: 1000px;
    height: calc(100vh - 120px); 
    display: flex; 
    align-items: center; 
    padding: 0 20px; 
    padding-bottom: 50px; 
    z-index: 10; 
}
.container { width: 100%; height: 100%; }
.tool-card { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-xl); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    width: 100%;
    height: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* 顶部结果条 */
.result-bar {
    padding: 16px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.cron-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 12px;
    font-size: 24px;
    font-family: var(--font-mono);
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 6px;
    outline: none;
}
.cron-input:focus { border-color: var(--primary-color); }
.btn-copy {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-copy:hover { opacity: 0.9; }
.cron-desc {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* 主体区 */
.cron-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 左侧：配置区 */
.fields-container {
    flex: 1.5;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field-group {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.field-header label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.field-type {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}
.field-type option { background: #111; }

.val-row { display: flex; gap: 10px; align-items: center; }
.field-val {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 4px;
    outline: none;
    width: 100%;
    font-size: 13px;
}
.field-val.small { width: 60px; text-align: center; }
.val-label { font-size: 12px; color: var(--text-muted); }

/* 指定选项网格 */
.specific-opts {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0,0,0,0.1);
    padding: 8px;
    border-radius: 6px;
}
.specific-opts label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-muted);
    transition: 0.1s;
}
.specific-opts label:hover { background: rgba(255,255,255,0.1); }
.specific-opts input { display: none; }
.specific-opts label:has(input:checked) { background: var(--primary-color); color: white; }

/* 右侧：预览区 */
.preview-panel {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

h3 {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
h3 i { color: var(--primary-color); }

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.preset-grid button {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}
.preset-grid button:hover { background: rgba(255,255,255,0.1); border-color: var(--primary-color); color: var(--primary-color); }

.next-runs ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.next-runs li {
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}
.next-runs li span.idx { color: var(--text-muted); font-weight: 600; }

/* 响应式 */
@media (max-width: 900px) {
    .cron-body { flex-direction: column; }
    .preview-panel { border-left: none; border-top: 1px solid var(--border-color); }
}
