/* media-ext 任务网站样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #1f2329;
    --muted: #86909c;
    --border: #e5e6eb;
    --primary: #165dff;
    --danger: #f53f3f;
    --green: #00b42a;
    --warn: #ff7d00;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17181c;
        --card: #232429;
        --text: #e8e9eb;
        --muted: #8a8f99;
        --border: #3a3c42;
        --primary: #4080ff;
    }
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--border);
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
    width: 40px; height: 40px; border-radius: 10px; background: var(--primary);
    color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.topbar h1 { font-size: 18px; }
.slogan { color: var(--muted); font-size: 12px; }

.status-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.green { background: var(--green); }
.dot.red { background: var(--danger); }
.dot.orange { background: var(--warn); }

main { max-width: 1080px; margin: 20px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.card h2 { font-size: 15px; margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head h2 { margin-bottom: 0; }

.badge { background: var(--border); color: var(--muted); border-radius: 8px; padding: 1px 8px; font-size: 12px; }

.chips { display: flex; gap: 12px; flex-wrap: wrap; }
.chip {
    border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
    display: flex; align-items: center; gap: 8px; font-size: 13px;
}

.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* 任务列表 */
.task-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.task-item {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 13px;
}
.task-name { min-width: 120px; }
.task-status { flex: 1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.log-wrap { margin-top: 4px; }

.form-row, .form-row-grid { margin-bottom: 12px; }
.form-row > label { display: block; margin-bottom: 6px; color: var(--muted); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button {
    border: none; background: transparent; color: var(--text);
    padding: 8px 18px; cursor: pointer; font-size: 13px;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--primary); color: #fff; }

textarea, input[type="number"], select {
    width: 100%; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text);
    padding: 8px 10px; font-size: 13px; font-family: inherit;
}
textarea:focus, input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

.form-row-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.form-item label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.checkbox-item { display: flex; align-items: flex-end; padding-bottom: 8px; }
.checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox input { width: auto; }

.form-actions { display: flex; gap: 12px; margin-top: 4px; }

.btn {
    border: 1px solid var(--border); border-radius: 8px; background: var(--card);
    color: var(--text); padding: 9px 22px; font-size: 14px; cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.ghost { background: transparent; }

.log {
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    height: 180px; overflow-y: auto; padding: 10px 12px;
    font-family: Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all;
}
.log .line { margin-bottom: 2px; }
.log .line.warn { color: var(--warn); }
.log .line.error { color: var(--danger); }
.log .line.success { color: var(--green); }
.log .t { color: var(--muted); margin-right: 6px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
td.title-cell { max-width: 320px; white-space: normal; }
th { background: var(--bg); color: var(--muted); font-weight: 500; }
tbody tr:hover { background: var(--bg); }

.export-bar { display: flex; gap: 8px; }

.media-list { list-style: none; font-size: 12px; color: var(--muted); }
.media-list li { padding: 3px 0; font-family: Consolas, monospace; }
.media-list li.failed { color: var(--danger); }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 40px; }

.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
    background: var(--card); border-radius: 12px; padding: 28px 32px;
    max-width: 520px; width: calc(100% - 40px); box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.modal-box h2 { margin-bottom: 12px; }
.steps { margin: 14px 0 18px 20px; }
.steps li { margin-bottom: 8px; }
.steps code {
    background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
    padding: 1px 6px; font-size: 12px;
}
.modal-actions { display: flex; justify-content: center; margin-top: 8px; }

.hidden { display: none !important; }

/* 封面缩略图 */
.thumb {
    width: 48px; height: 64px; object-fit: cover; border-radius: 4px;
    border: 1px solid var(--border); display: block;
}

/* 预览弹窗 */
.preview-box { max-width: 760px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.preview-head h2 { margin: 0; font-size: 15px; }
.preview-frame {
    width: 100%; height: 430px; border: none; border-radius: 8px;
    background: #000; display: block;
}
.preview-video {
    width: 100%; max-height: 62vh; border-radius: 8px;
    background: #000; display: block;
}
.preview-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px; max-height: 62vh; overflow-y: auto;
}
.preview-grid img {
    width: 100%; border-radius: 6px; cursor: zoom-in;
    border: 1px solid var(--border);
}
