/* ================================================================
   菜刀客在线工具页 · morse-code.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 说明横幅 ---- */
.morse-note {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.morse-note code {
    background: #e0e7ff;
    border-radius: 4px;
    padding: 0 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* ---- 快捷示例芯片 ---- */
.qchips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qchip {
    padding: 3px 10px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
}

.qchip:hover {
    border-color: #667eea;
    color: #4338ca;
    background: #eef2ff;
}

/* ---- 输入框 ---- */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.7;
}

/* ---- 音频参数网格 ---- */
.opt-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: -4px;
}

.opt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.range-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.range-head .val {
    font-size: 12px;
    font-weight: 600;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
}

input[type="range"].range {
    width: 100%;
    accent-color: #667eea;
    cursor: pointer;
}

/* ---- 输出框 ---- */
.out-box {
    min-height: 130px;
    max-height: 300px;
    overflow: auto;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.9;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-all;
}

.out-box.is-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.8;
}

/* ---- 播放器 ---- */
.player {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pl-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pl-state {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.pl-state.on {
    color: #16a34a;
}

.pl-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    transition: all 0.08s;
    flex-shrink: 0;
}

.pl-light.on {
    background: radial-gradient(circle at 35% 35%, #a5b4fc, #667eea);
    border-color: #4338ca;
    box-shadow: 0 0 12px 3px rgba(102, 126, 234, 0.6);
}

.pl-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.pl-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 999px;
}

.morse-strip {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.9;
    color: #9ca3af;
    max-height: 84px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    padding: 6px 8px;
    background: #f9fafb;
    border-radius: 6px;
}

.morse-strip .sym {
    color: #374151;
}

.morse-strip .sym.active {
    color: #4338ca;
    background: #e0e7ff;
    border-radius: 3px;
}

.morse-strip .wsep {
    color: #c7d2fe;
    padding: 0 2px;
}

.pl-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pl-loop {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}

.pl-loop input {
    accent-color: #667eea;
    width: 15px;
    height: 15px;
}

/* ---- 摩斯电码对照表 ---- */
.ref-sub {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 14px 0 8px;
}

.ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
    margin: 8px 0 4px;
}

.ref-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s;
}

.ref-cell:hover {
    border-color: #667eea;
    background: #eef2ff;
}

.ref-cell .rc-char {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
}

.ref-cell:hover .rc-char {
    color: #4338ca;
}

.ref-cell .rc-code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #6b7280;
    letter-spacing: 1px;
}

/* ---- 小屏适配 ---- */
@media (max-width: 600px) {
    .opt-grid {
        grid-template-columns: 1fr;
    }

    .out-box {
        min-height: 110px;
        max-height: 240px;
    }

    .ref-grid {
        grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    }

    .pl-loop {
        margin-left: 0;
    }
}
