* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, "Microsoft JhengHei", sans-serif;
    background: #f4f6f8;
    color: #222;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.logo {
    height: 60px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px;
    gap: 20px;
    box-sizing: border-box;
}

.card {
    width: 100%;
    max-width: 760px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    padding: 28px;
    box-sizing: border-box;
}

h1 {
    margin-top: 0;
    margin-bottom: 8px;
}

.desc {
    color: #666;
    margin-top: 0;
    margin-bottom: 15px;
}

.row {
    margin-bottom: 16px;
}

.buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    border: 0;
    background: #2563eb;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    opacity: 0.92;
}

button.success {
    background: #059669;
}

button.danger {
    background: #dc2626;
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 1;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    user-select: none;
}

.check-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.hint {
    margin-top: 0;
    margin-bottom: 16px;
    color: #666;
    font-size: 14px;
}

.panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
}

.progress-box {
    width: 100%;
    height: 28px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #16a34a;
    color: #fff;
    text-align: center;
    line-height: 28px;
    transition: width 0.25s ease;
}

.download-area {
    margin-top: 8px;
    min-height: 24px;
    color: #374151;
}

.error-box {
    margin-top: 16px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px;
    white-space: pre-wrap;
}

.hidden {
    display: none;
}

.json-card {
    width: 100%;
    max-width: 760px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    padding: 20px 28px 28px 28px;
    box-sizing: border-box;
}

.json-section {
    margin-top: 20px;
}

.json-section h3 {
    margin-bottom: 8px;
}

#jsonOutput {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    min-height: 200px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.json-key {
    color: #9cdcfe;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

.json-boolean {
    color: #569cd6;
}

.json-null {
    color: #c586c0;
}
