body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #edf1f8 0%, #d8e0ee 100%);
    color: #222;
}

.site-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.site-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 6px;
}

.site-title {
    font-size: 16px;
    font-weight: 700;
    color: #23417b;
}

.tabs {
    display: flex;
    gap: 2px;
    max-width: 960px;
    margin: 0 auto;
    padding: 18px 20px 0;
}

.tabs button {
    flex: 1;
    padding: 14px 18px;
    border: none;
    background: #dde4f1;
    color: #2f3e5b;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    font-size: 15px;
    transition: background 0.2s ease, color 0.2s ease;
}

#login-box input {
    margin-bottom: 16px;
}

#login-box button {
    background: #4563e0;
    color: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#auth-box button {
    background: #4563e0;
    color: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    width: auto;
}

.secondary-btn {
    background: transparent;
    color: #3b4d72;
    border: 1px solid #c9d3e8;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
}

#auth-box button:hover,
#login-box button:hover,
.secondary-btn:hover {
    background: #2f4ed5;
    color: #fff;
}

#gen-btn {
    flex: 0 0 auto;
    margin-left: 10px;
}

#copy-btn {
    flex: 0 0 auto;
    margin-left: 10px;
    background: #4b7dff;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#copy-btn:hover {
    background: #345ed8;
}

.download-search-wrapper {
    max-width: 960px;
    margin: 0 auto 16px;
    padding: 0 20px;
}

.search-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #c9d3e8;
    border-radius: 12px;
    background: #f4f6fb;
    color: #1f2a42;
    font-size: 15px;
}

.search-input:focus {
    outline: none;
    border-color: #8aa2db;
    box-shadow: 0 0 0 4px rgba(138, 162, 219, 0.18);
}

.group-title {
    margin: 20px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1f3255;
}

.search-input[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.group-title {
    margin: 20px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1f3255;
}

#driver-select {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre;
}

#driver-select option {
    font-family: inherit;
    white-space: pre;
}

.result-panel {
    width: 100%;
    border: 1px solid #c9d3e8;
    border-radius: 16px;
    background: #f7f9ff;
    padding: 20px;
    margin-top: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.result-panel h3 {
    margin: 0 0 14px;
    font-size: 18px;
    color: #23417b;
}

.result-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.result-row span:first-child {
    width: 90px;
    font-weight: 700;
    color: #3b4d72;
}

#result-code {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border: 1px solid #c9d3e8;
    border-radius: 12px;
    background: #fff;
    color: #1f2a42;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    resize: vertical;
}

.row input,
.row select {
    flex: 1 1 0;
    min-width: 0;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-bottom: 22px;
}

#login-box h2,
#auth-box h2 {
    margin-bottom: 24px;
    font-size: 26px;
    color: #1c2c54;
}

#login-box {
    width: min(520px, 100%);
}

.tabs button.active {
    background: #fff;
    color: #1b2d55;
    font-weight: 700;
    box-shadow: inset 0 -2px 0 #1b2d55;
}

.tabcontent {
    padding: 30px 20px 40px;
}

.card {
    background: #ffffffee;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(29, 73, 148, 0.12);
    width: min(720px, 100%);
    max-width: 720px;
}

.center {
    margin: 28px auto;
    text-align: left;
}

.hidden {
    display: none
}

.row {
    display: flex;
    align-items: center;
    margin: 14px 0;
    gap: 12px;
    flex-wrap: wrap;
}

.row label {
    width: 135px;
    font-weight: 600;
    color: #3b4d72;
}

.row input,
.row select,
.row button {
    min-width: 0;
}

.row button {
    flex: 0 0 auto;
}

.row input,
.row select {
    flex: 1;
}

.row input[type="text"],
.row input[type="password"],
.row select {
    padding: 14px 16px;
}

.row input,
.row select {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #c9d3e8;
    border-radius: 12px;
    background: #f4f6fb;
    color: #1f2a42;
    font-size: 15px;
}

.row input:focus,
.row select:focus {
    outline: none;
    border-color: #8aa2db;
    box-shadow: 0 0 0 4px rgba(138, 162, 219, 0.18);
}

.download-layout {
    display: flex;
    gap: 16px;
    height: calc(100vh - 120px);
    min-height: 480px;
}

.index {
    width: 300px;
    border-right: 1px solid #d4dbe8;
    padding: 12px 10px 12px 14px;
    background: #e8eef6;
    overflow-y: auto;
    height: 100%;
}

.tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    height: 100%;
    background: #dee6f3;
    border-radius: 0 12px 12px 0;
}

.tree-item {
    margin-bottom: 6px;
}

.tree-item>.tree-list {
    margin-top: 6px;
    margin-left: 12px;
    border-left: 1px dashed #ddd;
    padding-left: 10px;
}

.tree-button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #333;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.tree-button:hover {
    background: #e8f0fe;
}

.tree-button.active {
    background: #d5e7ff;
    color: #1a56d0;
    font-weight: 600;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 16px;
    margin-bottom: 12px;
}

.content-title {
    color: #555;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.search-input {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
}

.file-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}

.file-card.missing-data {
    border-color: #f8c1c3;
    background: #fff4f4;
}

.file-card.missing-data .file-link {
    color: #b21f2d;
}

.missing-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ffd7d9;
    color: #8a1b24;
    font-size: 12px;
    font-weight: 700;
}

.file-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-link {
    font-size: 15px;
    font-weight: 600;
    color: #1a73e8;
    text-decoration: none;
}

.file-link:hover {
    text-decoration: underline;
}

.file-meta {
    display: grid;
    gap: 6px;
    color: #444;
    font-size: 14px;
}

.file-name {
    font-weight: 600;
}

.file-version {
    color: #666;
}

.instruction-link {
    color: #0b66c3;
    text-decoration: none;
}

.instruction-link:hover {
    text-decoration: underline;
}

.empty-state {
    color: #888;
    padding: 14px;
    border: 1px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
}

@media (max-width: 860px) {
    .tabs {
        flex-direction: column;
        padding: 14px 16px 0;
    }

    .tabs button {
        border-radius: 12px;
    }

    .tabcontent {
        padding: 20px 16px 32px;
    }

    .card {
        width: 100%;
        padding: 24px;
        border-radius: 18px;
    }

    .auth-header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-header h2 {
        margin-bottom: 10px;
    }

    .row {
        flex-direction: column;
        align-items: stretch;
    }

    .row label {
        width: auto;
    }

    .row input,
    .row select,
    .row button {
        width: 100%;
    }

    #gen-btn,
    #copy-btn {
        margin-left: 0;
    }

    .download-layout {
        display: flex;
        flex-direction: column;
        gap: 12px;
        height: auto;
        min-height: 0;
    }

    .index {
        width: 100%;
        min-height: 180px;
        max-height: 280px;
        border-right: none;
        border-bottom: 1px solid #d4dbe8;
        border-radius: 12px;
    }

    .content {
        border-radius: 12px;
        min-height: 300px;
        height: auto;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-title {
        font-size: 13px;
    }

    .file-card {
        padding: 14px;
    }
}

.feedback-msg {
    margin-top: 8px;
    min-height: 20px;
    font-size: 13px;
}

.feedback-msg.success {
    color: #1c7c2c;
}

.feedback-msg.error {
    color: #b21f2d;
}

.msg {
    color: red;
    margin-top: 8px
}