:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --line: #e6ebf2;
    --text: #1f2328;
    --muted: #667085;
    --primary: #1677ff;
    --danger: #d92d20;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
    --radius: 18px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.app-header { background: #111827; color: #fff; }
.app-header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: #fff; font-size: 18px; font-weight: 700; }
.nav a { color: rgba(255,255,255,.86); margin-left: 18px; }
.app-main { padding: 28px 0 40px; }
.hero-card, .card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}
.hero-card { padding: 24px; margin-bottom: 20px; }
.card { padding: 22px; margin-bottom: 20px; }
.grid { display: grid; gap: 20px; }
.two-col { grid-template-columns: 1fr 1fr; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 8px; font-weight: 600; }
input[type="text"], input[type="file"], textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d7e2;
    border-radius: 12px;
    background: #fff;
    outline: none;
}
textarea { resize: vertical; min-height: 120px; }
.checkbox-field { display: flex; align-items: center; gap: 10px; }
.checkbox-field input { width: 18px; height: 18px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}
.btn-light { background: #eef4ff; color: var(--primary); }
.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-danger { background: #fff3f2; color: var(--danger); border-color: #f7c7c2; }
.muted { color: var(--muted); }
.preview-box {
    min-height: 280px;
    border: 1px dashed #c8d4e6;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: #fafcff;
}
.preview-box.is-empty img { display: none; }
.preview-box img { max-height: 260px; border-radius: 12px; }
.decode-status { min-height: 24px; margin-bottom: 12px; font-weight: 600; }
.decode-status.is-success { color: #0f8f45; }
.decode-status.is-warn { color: #b56900; }
.decode-status.is-danger { color: var(--danger); }
.decode-status.is-loading { color: var(--primary); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.copy-row { display: flex; gap: 10px; }
.copy-row input { flex: 1; }
.subcard { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fcfdff; }
.kv { margin: 0; }
.kv div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #e7edf5; }
.kv div:last-child { border-bottom: 0; }
.kv dt { font-weight: 700; color: #475467; }
.kv dd { margin: 0; word-break: break-word; }
.code-block {
    margin: 0;
    padding: 16px;
    border-radius: 14px;
    background: #0f172a;
    color: #e2e8f0;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.image-frame {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fafcff, #f2f6fb);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
}
.image-frame img { max-height: 420px; }
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .result-head, .copy-row { flex-direction: column; align-items: stretch; }
}
