/* ============================================================
   动图设计 anim-studio · zhandu.cn
   像素动画编辑器 UI；适配 PC / 手机 / 平板
   ============================================================ */

.as-card { padding: 20px 18px 16px; }

/* ---------- 顶栏：新建 / 工程文件 ---------- */
.as-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #eceff4;
}

.as-topbar .as-label { font-size: 13px; color: #5b6b85; }

.as-sizepreset,
.as-input {
    font-size: 13.5px;
    color: #1d2940;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    padding: 6px 8px;
}

.as-input { width: 64px; text-align: center; }

.as-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    font-weight: 600;
    color: #33415c;
    background: #f1f4f9;
    border: 1px solid #e2e8f1;
    border-radius: 9px;
    padding: 7px 13px;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}

.as-btn:hover { color: #1d4ed8; border-color: #b9cffb; background: #eef4ff; }
.as-btn:active { transform: scale(.96); }
.as-btn.danger:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.as-btn.primary {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .25);
}
.as-btn.primary:hover { box-shadow: 0 6px 16px rgba(37, 99, 235, .35); color: #fff; }

/* ---------- 工作区三栏 ---------- */
.as-workspace {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

/* 工具列 */
.as-tools {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.as-tool {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #e2e8f1;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    color: #47536b;
}

.as-tool:hover { border-color: #93b4f5; background: #f3f8ff; }
.as-tool.on {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .3);
}

/* 画布区 */
.as-canvas-wrap { flex: 1; min-width: 0; }

.as-stage-wrap {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(45deg, #e9edf3 25%, transparent 25%, transparent 75%, #e9edf3 75%),
        linear-gradient(45deg, #e9edf3 25%, transparent 25%, transparent 75%, #e9edf3 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    background-color: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(15, 23, 42, .05);
}

.as-stage,
.as-gridcv,
.as-overlay,
.as-overlayhit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.as-stage { image-rendering: pixelated; }
.as-gridcv { pointer-events: none; }
.as-overlay { pointer-events: none; image-rendering: pixelated; }
.as-overlayhit { cursor: crosshair; touch-action: none; }

.as-hintbar {
    max-width: 520px;
    margin: 10px auto 0;
    font-size: 12.5px;
    color: #6b7a94;
    background: #f5f7fb;
    border-radius: 8px;
    padding: 7px 12px;
    text-align: center;
    line-height: 1.6;
}

/* 右侧面板 */
.as-side {
    width: 172px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.as-panel {
    background: #f8fafd;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    padding: 10px 12px;
}

.as-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: #8291ab;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.as-colorrow { display: flex; align-items: center; gap: 10px; }

.as-colorcur {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #dbe3ee, 0 2px 6px rgba(15, 23, 42, .12);
    flex-shrink: 0;
}

.as-colorinput {
    width: 100%;
    height: 34px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
    padding: 2px;
    cursor: pointer;
}

.as-palette,
.as-recent {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.as-recent { grid-template-columns: repeat(5, 1fr); min-height: 24px; }

.as-sw {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, .12);
    cursor: pointer;
    padding: 0;
    transition: transform .12s;
}

.as-sw:hover { transform: scale(1.15); z-index: 2; position: relative; }

.as-rangerow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #47536b; }
.as-rangerow input[type="range"] { flex: 1; accent-color: #2563eb; }
.as-rangerow b { font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }

.as-switchrow { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #33415c; padding: 3px 0; cursor: pointer; }
.as-switchrow input { accent-color: #2563eb; width: 16px; height: 16px; cursor: pointer; }

.as-minirow { display: flex; gap: 6px; }
.as-mini {
    flex: 1;
    font-size: 12.5px;
    font-weight: 600;
    color: #33415c;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    padding: 6px 0;
    cursor: pointer;
    transition: all .15s;
}
.as-mini:hover { color: #1d4ed8; border-color: #93b4f5; background: #f3f8ff; }

/* ---------- 帧条与播放 ---------- */
.as-framesbar {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eceff4;
}

.as-playrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.as-playbtn {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border: none;
    border-radius: 10px;
    padding: 9px 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(22, 163, 74, .25);
    transition: all .15s;
    min-width: 110px;
}

.as-playbtn:hover { box-shadow: 0 6px 16px rgba(22, 163, 74, .35); transform: translateY(-1px); }

.as-framelabel { font-size: 13px; color: #5b6b85; font-variant-numeric: tabular-nums; }

.as-framebtns { display: flex; gap: 6px; flex-wrap: wrap; }

.as-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scrollbar-width: thin;
}

.as-thumb {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 9px;
    border: 2px solid #dbe3ee;
    background:
        linear-gradient(45deg, #eef1f6 25%, transparent 25%, transparent 75%, #eef1f6 75%),
        linear-gradient(45deg, #eef1f6 25%, transparent 25%, transparent 75%, #eef1f6 75%);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, transform .15s;
}

.as-thumb canvas { width: 44px; height: 44px; image-rendering: pixelated; pointer-events: none; }
.as-thumb i {
    position: absolute;
    right: 2px;
    bottom: 1px;
    font-style: normal;
    font-size: 10px;
    color: #fff;
    background: rgba(15, 23, 42, .55);
    border-radius: 6px;
    padding: 0 4px;
    pointer-events: none;
}
.as-thumb:hover { border-color: #93b4f5; transform: translateY(-2px); }
.as-thumb.on { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }

/* ---------- 导出区 ---------- */
.as-export {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eceff4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.as-export .as-label { font-size: 13px; color: #8291ab; margin-right: 2px; }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
    .as-workspace { flex-direction: column; }
    .as-tools { flex-direction: row; flex-wrap: wrap; order: 1; }
    .as-canvas-wrap { order: 0; width: 100%; }
    .as-side { order: 2; width: 100%; flex-direction: row; flex-wrap: wrap; }
    .as-side .as-panel { flex: 1 1 46%; min-width: 150px; }
    .as-btn { padding: 9px 13px; }
    .as-mini, .as-tool { min-height: 40px; }
}
