* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: #fff; color: #333; height: 100vh; overflow: hidden;
    display: flex; flex-direction: column;
}
.header {
    height: 50px; background: #4a90d9; color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; flex-shrink: 0;
}
.header-title { font-size: 18px; font-weight: bold; }
.web-tag {
    font-size: 12px; font-weight: normal; background: rgba(255,255,255,0.25);
    padding: 2px 8px; border-radius: 10px; margin-left: 6px;
}
.header-btn {
    padding: 8px 20px; background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.5); border-radius: 4px;
    color: #fff; font-size: 14px; cursor: pointer;
}
.header-btn:hover { background: rgba(255,255,255,0.3); }
.account-info { color: #fff; font-size: 13px; }

.container {
    display: flex; flex: 1; gap: 10px; padding: 10px; overflow: hidden;
}
.left-panel {
    width: 310px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}
.parse-panel {
    width: 370px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}
.col-panel {
    flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.upload-box {
    border: 2px dashed #ccc; border-radius: 4px; padding: 20px; text-align: center;
    cursor: pointer; background: #fafafa; transition: border-color 0.2s;
}
.upload-box:hover { border-color: #4a90d9; }
.upload-box.selected { border-color: #4caf50; background: #f0f9f0; }
.upload-icon { font-size: 32px; color: #999; margin-bottom: 6px; }
.upload-text { color: #666; font-size: 13px; }
.file-name { color: #4a90d9; font-size: 12px; margin-top: 6px; word-break: break-all; }
.prompt-box { border: 1px solid #ccc; border-radius: 4px; padding: 10px; background: #fff; }
.prompt-box textarea {
    width: 100%; border: none; resize: none; outline: none;
    font-size: 13px; font-family: inherit; height: 100px;
}
.btn-row { display: flex; gap: 8px; }
.btn {
    flex: 1; padding: 10px; border: none; border-radius: 4px;
    font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: #4a90d9; color: #fff; }
.btn-primary:hover { background: #3a7fc8; }
.btn-primary:disabled { background: #a0c4e8; cursor: not-allowed; }
.btn-secondary { background: #ff9800; color: #fff; }
.btn-secondary:hover { background: #e68900; }
.btn-secondary:disabled { background: #ffcc80; cursor: not-allowed; }
.btn-success { background: #4caf50; color: #fff; }
.btn-success:hover { background: #43a047; }
.btn-success:disabled { background: #a5d6a7; cursor: not-allowed; }
.btn-full {
    width: 100%; padding: 10px; border: none; border-radius: 4px;
    font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s;
}
.btn-full.btn-primary { background: #4a90d9; color: #fff; }
.btn-full.btn-primary:hover { background: #3a7fc8; }
.btn-full.btn-primary:disabled { background: #a0c4e8; cursor: not-allowed; }
.btn-full.btn-success { background: #4caf50; color: #fff; }
.btn-full.btn-success:hover { background: #43a047; }
.btn-full.btn-success:disabled { background: #a5d6a7; cursor: not-allowed; }
.btn-full.btn-secondary { background: #ff9800; color: #fff; }
.btn-full.btn-secondary:hover { background: #e68900; }
.btn-full.btn-secondary:disabled { background: #ffcc80; cursor: not-allowed; }
.log-box {
    flex: 1; border: 1px solid #ccc; border-radius: 4px; background: #fafafa;
    overflow: hidden; display: flex; flex-direction: column; min-height: 120px;
}
.log-header { padding: 6px 12px; background: #eee; font-size: 12px; font-weight: bold; border-bottom: 1px solid #ddd; }
.log-content {
    flex: 1; padding: 8px; overflow-y: auto; font-family: 'Consolas', monospace; font-size: 12px; line-height: 1.6;
}
.log-item { color: #666; word-break: break-all; }
.log-item.success { color: #4caf50; }
.log-item.error { color: #f44336; }
.log-item.info { color: #2196f3; }
.preview-box {
    flex: 1; border: 1px solid #ccc; border-radius: 4px; background: #fff;
    overflow: hidden; display: flex; flex-direction: column;
}
.preview-header {
    padding: 10px 12px; background: #f5f5f5; font-size: 13px; font-weight: bold;
    border-bottom: 1px solid #ddd;
}
.preview-body {
    flex: 1; overflow-y: auto; padding: 15px;
    font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word;
}
.preview-body:focus { outline: none; user-select: text; -webkit-user-select: text; }
.btn-export {
    padding: 4px 12px; border: none; border-radius: 4px;
    font-size: 12px; cursor: pointer; color: #fff; white-space: nowrap;
}
.btn-export-word { background: #2b579a; }
.btn-export-word:hover { background: #1d3f7a; }
.btn-export-pdf { background: #d32f2f; }
.btn-export-pdf:hover { background: #b71c1c; }
.btn-export-txt { background: #388e3c; }
.btn-export-txt:hover { background: #2e7d32; }
.btn-import-txt { background: #7b1fa2; }
.btn-import-txt:hover { background: #6a1b9a; }
.image-preview-box {
    flex: 1; border: 1px solid #ccc; border-radius: 4px; background: #fff;
    overflow: hidden; display: flex; flex-direction: column;
}
.image-preview-header {
    padding: 10px 12px; background: #f5f5f5; font-size: 13px; font-weight: bold;
    border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center;
}
.image-preview-content {
    flex: 1; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.image-preview-content img {
    width: 100%; max-width: 100%; height: auto; object-fit: contain;
    border: 1px solid #eee; border-radius: 4px;
}
.loading-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
    display: none; justify-content: center; align-items: center; z-index: 1000;
}
.loading-overlay.show { display: flex; }
.loading-box {
    background: #fff; padding: 30px 50px; border-radius: 8px; text-align: center;
}
.loading-spinner {
    width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid #4a90d9;
    border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-text { color: #333; font-size: 14px; }
.settings-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.settings-row label { font-size: 12px; color: #666; width: 70px; flex-shrink: 0; }
.settings-row input {
    flex: 1; padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; outline: none;
}
.settings-row input:focus { border-color: #4a90d9; }
.section-box { border: 1px solid #ddd; border-radius: 4px; padding: 12px; background: #fff; }
.section-title { font-size: 13px; font-weight: bold; color: #333; margin-bottom: 8px; }
.api-group {
    background: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 6px;
    padding: 14px; margin-bottom: 12px;
}
.api-group-title {
    font-size: 13px; font-weight: bold; color: #333; margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 1px solid #e0e0e0;
}
.api-link { margin-top: 6px; text-align: right; }
.api-link a { color: #4a90d9; font-size: 12px; text-decoration: none; }
.api-link a:hover { text-decoration: underline; }
.provider-status {
    font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: normal;
}
.provider-status.enabled { background: #c8e6c9; color: #2e7d32; }
.provider-status.disabled { background: #f5f5f5; color: #999; }
.btn-toggle {
    padding: 3px 12px; border: none; border-radius: 4px;
    font-size: 11px; cursor: pointer; margin-left: 4px;
}
.btn-toggle-enable { background: #4caf50; color: #fff; }
.btn-toggle-enable:hover { background: #43a047; }
.btn-toggle-disable { background: #e0e0e0; color: #666; }
.btn-toggle-disable:hover { background: #bdbdbd; }
.btn-toggle-active { background: #4caf50; color: #fff; box-shadow: 0 0 0 2px rgba(76,175,80,0.3); }
.btn-toggle-inactive { background: #f44336; color: #fff; }
.btn-toggle-inactive:hover { background: #e53935; }
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
    display: none; justify-content: center; align-items: center; z-index: 1001;
}
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 8px; padding: 25px; width: 480px; max-width: 90%; }
.modal-header { font-size: 16px; font-weight: bold; color: #333; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.modal-close { float: right; cursor: pointer; font-size: 20px; color: #999; }
.modal-close:hover { color: #333; }
.modal-footer { margin-top: 20px; text-align: right; }
.modal-btn { padding: 10px 25px; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; }
.modal-btn-primary { background: #4a90d9; color: #fff; }
.modal-btn-primary:hover { background: #3a7fc8; }
.modal-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.mtab {
    flex: 1; padding: 8px; border: 1px solid #e0e0e0; background: #f5f5f5; color: #666;
    border-radius: 4px; font-size: 13px; cursor: pointer;
}
.mtab.active { background: #4a90d9; color: #fff; border-color: #4a90d9; }
.mtab-panel.hidden { display: none; }
.hint { font-size: 12px; color: #888; line-height: 1.7; background: #f5f5f5; padding: 10px; border-radius: 4px; margin-bottom: 14px; }
.redeem-guide { background: #f0f6ff; border: 1px solid #cfe3ff; border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; }
.rg-title { font-size: 13px; font-weight: bold; color: #2b6cb0; margin-bottom: 8px; }
.rg-list { margin: 0 0 8px 18px; padding: 0; }
.rg-list li { font-size: 12px; color: #444; line-height: 1.9; }
.rg-list code, .rg-note code { background: #e8f0ff; padding: 1px 6px; border-radius: 3px; font-size: 11px; color: #1a4d8f; }
.rg-note { font-size: 12px; color: #555; line-height: 1.7; margin: 0; }
.rg-note b { color: #c0392b; }
.guest-btn { width: 100%; margin-top: 10px; background: #fff; color: #4a90d9; border: 1px solid #4a90d9; }
.guest-btn:hover { background: #eef5fc; }
.err { color: #f44336; font-size: 12px; margin-top: 10px; min-height: 14px; }
.toast {
    position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
    background: rgba(0,0,0,0.8); color: #fff; padding: 10px 22px; border-radius: 6px;
    font-size: 13px; opacity: 0; transition: opacity .25s; z-index: 1100; pointer-events: none;
}
.toast.show { opacity: 1; }
.hidden { display: none !important; }
