/* ============================================================
   Live Photo 转换工具 - 样式表
   适配子比主题，使用主题 CSS 变量
   ============================================================ */

:root {
    --lp-bg: var(--main-bg-color, #f5f6fa);
    --lp-text: var(--main-color, #2c3e50);
    --lp-muted: var(--muted-2-color, #8899aa);
    --lp-brand: var(--theme-color, #6366f1);
    --lp-accent: #10b981;
    --lp-border: var(--main-border-color, #e2e8f0);
    --lp-card-bg: var(--main-bg-color, #ffffff);
    --lp-radius: var(--main-radius, 12px);
    --lp-shadow: var(--main-shadow, 0 2px 12px rgba(0,0,0,.08));
    --lp-warning: #f59e0b;
}

.dark-theme {
    --lp-bg: var(--main-bg-color, #1a1d2e);
    --lp-text: var(--main-color, #e6e9f2);
    --lp-muted: var(--muted-2-color, #8891ad);
    --lp-border: var(--main-border-color, #243056);
    --lp-card-bg: rgba(33,39,78,.32);
}

/* ---------- 全局 ---------- */
.livephoto-app {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 16px 60px;
    color: var(--lp-text);
    font-family: inherit;
    line-height: 1.6;
}

/* ---------- 头部 ---------- */
.lp-head {
    margin-bottom: 24px;
}

.lp-head h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--lp-brand), var(--lp-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lp-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--lp-border);
    color: var(--lp-muted);
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}

.lp-sub {
    color: var(--lp-muted);
    font-size: 15px;
}

/* ---------- 卡片 ---------- */
.lp-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 1024px) {
    .lp-grid {
        grid-template-columns: 1fr;
    }
}

.lp-card {
    background: var(--lp-card-bg);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    box-shadow: var(--lp-shadow);
    overflow: hidden;
}

.lp-card h2 {
    font-size: 16px;
    font-weight: 700;
    padding: 16px 18px;
    border-bottom: 1px solid var(--lp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lp-step {
    font-size: 11px;
    color: var(--lp-muted);
    background: var(--main-bg-color, #f0f0f0);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}

/* ---------- 拖拽区 ---------- */
.lp-dropzone {
    margin: 16px;
    border: 2px dashed var(--lp-border);
    border-radius: var(--lp-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
}

.lp-dropzone:hover,
.lp-dropzone.drag-over {
    border-color: var(--lp-brand);
    background: rgba(99,102,241,.05);
}

.lp-dropzone p {
    margin: 4px 0;
}

.lp-muted {
    color: var(--lp-muted);
    font-size: 13px;
}

/* ---------- 文件列表 ---------- */
.lp-file-list {
    margin: 0 16px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lp-file-item {
    background: var(--main-bg-color, #f8f9fa);
    border: 1px solid var(--lp-border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lp-file-item .lp-file-remove {
    cursor: pointer;
    color: var(--lp-muted);
    font-weight: bold;
}

.lp-file-item.active {
    border-color: var(--lp-brand);
}

/* ---------- 预览区 ---------- */
.lp-preview-box {
    margin: 16px;
    aspect-ratio: 16 / 10;
    background: #000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.lp-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lp-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lp-preview-placeholder {
    color: var(--lp-muted);
    font-size: 14px;
}

/* ---------- 截取信息 ---------- */
.lp-trim-info {
    margin: 0 16px 16px;
    font-size: 13px;
    color: var(--lp-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* ---------- 警告条 ---------- */
.lp-warning {
    margin: 16px;
    padding: 12px 16px;
    background: rgba(245,158,11,.12);
    border-radius: 6px;
    font-size: 13px;
    color: var(--lp-warning);
    line-height: 1.6;
}

/* ---------- 设置项 ---------- */
.lp-settings {
    margin: 0 16px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lp-setting-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lp-setting-item label {
    font-size: 13px;
    color: var(--lp-muted);
}

.lp-setting-item select {
    padding: 8px 12px;
    border: 1px solid var(--lp-border);
    border-radius: 6px;
    background: var(--main-bg-color, #fff);
    color: var(--lp-text);
    font-size: 14px;
    cursor: pointer;
}

/* ---------- 按钮 ---------- */
.lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.lp-btn-primary {
    background: linear-gradient(135deg, var(--lp-brand), var(--lp-accent));
    color: #fff;
    margin: 0 16px 16px;
    width: calc(100% - 32px);
}

.lp-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.lp-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ---------- 输出区 ---------- */
.lp-output-box {
    margin: 16px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.lp-output-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--main-bg-color, #f8f9fa);
    border-radius: 8px;
}

.lp-output-item img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
}

.lp-output-item .lp-output-info {
    flex: 1;
}

.lp-output-item .lp-output-name {
    font-size: 14px;
    font-weight: 600;
}

.lp-output-item .lp-output-size {
    font-size: 12px;
    color: var(--lp-muted);
}

.lp-download-btn {
    padding: 6px 16px;
    border-radius: 6px;
    background: var(--lp-brand);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

/* ---------- 底部工具介绍 ---------- */
.lp-divider {
    text-align: center;
    margin: 40px 0 24px;
    position: relative;
    color: var(--lp-muted);
    font-size: 14px;
}

.lp-divider::before,
.lp-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--lp-border);
}

.lp-divider::before {
    left: 0;
}

.lp-divider::after {
    right: 0;
}

.lp-divider span {
    background: var(--lp-bg);
    padding: 0 16px;
    position: relative;
}

.lp-intro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .lp-intro-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .lp-intro-grid {
        grid-template-columns: 1fr;
    }
}

.lp-intro-item {
    background: var(--lp-card-bg);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--lp-shadow);
    transition: transform .2s;
}

.lp-intro-item:hover {
    transform: translateY(-2px);
}

.lp-intro-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

.lp-intro-item h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.lp-intro-item p {
    font-size: 13px;
    color: var(--lp-muted);
    line-height: 1.6;
}