/* ================================================================
   菜刀客在线工具页 · danmaku-generator（全屏手持弹幕生成器）私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ── 颜色预设小色块 ─────────────────────────────────── */
.dm-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dm-swatch {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.dm-swatch.active {
    outline: 2px solid #667eea;
    outline-offset: 1px;
}

.dm-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dm-color-row input[type="color"] {
    width: 42px;
    height: 30px;
    padding: 2px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.dm-row-tip {
    font-size: 12px;
    color: #9ca3af;
}

/* ── 快捷表白符号选择器 ─────────────────────────── */
.dm-symbol-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dm-symbol-label {
    font-size: 12px;
    color: #9ca3af;
    margin-right: 2px;
}

.dm-sym {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.dm-sym:hover {
    border-color: #667eea;
    background: #eef2ff;
    transform: translateY(-1px);
}

/* ── 预览区 ──────────────────────────────────────────── */
.dm-preview {
    position: relative;
    overflow: hidden;
    height: 300px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #000;
}

.dm-preview .dm-stage,
#dmscreen .dm-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.dm-stage.bg-black { background: #000; }
.dm-stage.bg-grad  { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.dm-stage.bg-white { background: #fff; }

.dm-line {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    padding: 0;
    font-weight: 800;
    letter-spacing: 2px;
    white-space: nowrap;
    line-height: 1;
    will-change: transform;
    text-transform: none;
}

.dm-line.outline-w {
    text-shadow:
        0 2px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff,
        0 0 6px #fff;
}

.dm-line.outline-b {
    text-shadow:
        0 2px 0 #111, 0 -2px 0 #111, 2px 0 0 #111, -2px 0 0 #111,
        0 0 6px #111;
}

/* 从下到上模式：每个字旋转90°，叠成竖条滚动 */
.dm-line .dm-rot {
    display: block;
    transform: rotate(90deg);
}

/* ── 全屏展示层 ──────────────────────────────────────── */
#dmscreen {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: none;
    background: #000;
}

#dmscreen.visible {
    display: block;
}

.dm-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 40px;
    height: 40px;
    z-index: 10;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.3s;
}

.dm-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 显示 2 秒后淡出，单击屏幕后重新显示 */
#dmscreen.dm-close-hid .dm-close {
    opacity: 0;
    pointer-events: none;
}

/* 纯白背景下的关闭按钮 */
#dmscreen.bg-white .dm-close {
    background: rgba(0, 0, 0, 0.1);
    color: #111;
}

#dmscreen.bg-white .dm-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* 预览提示角标 */
.dm-corner-tip {
    position: absolute;
    left: 8px;
    top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    z-index: 5;
    pointer-events: none;
}

/* ── 面板布局：预览区在左且占弹性宽度，设置在右固定 400px ── */
.main { grid-template-columns: 1fr 400px; }

@media (max-width: 900px) {
    .main { grid-template-columns: 1fr; }
}