/**
 * ThinkCMF Installation Styles
 * Native CSS + jQuery 3.7 - Blue Theme
 */

/* Reset and Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Navbar - Blue Theme */
.navbar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    padding: 0;
    height: 60px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
    padding-top: 12px;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 500;
    color: #fff;
}

.navbar-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Install Wrap */
.install-wrap {
    max-width: 900px;
    margin: 30px auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Step Bar */
.step-bar {
    display: flex;
    justify-content: center;
    padding: 30px 0;
    border-bottom: 1px solid #e8e8e8;
}

.step-bar .step-item {
    display: flex;
    align-items: center;
    padding: 0 40px;
    position: relative;
}

.step-bar .step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 30px;
    background: #e8e8e8;
}

.step-bar .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #93c5fd;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin-right: 10px;
}

.step-bar .step-item.active .step-num {
    background: #3b82f6;
}

.step-bar .step-text {
    font-size: 14px;
    color: #999;
}

.step-bar .step-item.active .step-text {
    color: #3b82f6;
    font-weight: 500;
}

/* Install Content */
.install-content {
    padding: 30px 40px 40px;
}

/* Agreement Box */
.agreement-box {
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}

.agreement-title {
    padding: 15px 20px;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    border-bottom: 1px solid #e8e8e8;
    background: #fafafa;
}

.agreement-text {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.8;
    color: #666;
}

.agreement-text p {
    margin-bottom: 10px;
}

.agreement-text ol {
    padding-left: 20px;
}

.agreement-text li {
    margin-bottom: 8px;
}

/* Tables */
.install-table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
    font-size: 13px;
}

.install-table thead th {
    background: #fafafa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
    color: #333;
    border: 1px solid #e8e8e8;
}

.install-table tbody td {
    padding: 10px 15px;
    border: 1px solid #e8e8e8;
    color: #666;
}

.install-table tbody tr:hover {
    background: #fafafa;
}

/* Icons */
.check-icon {
    color: #3b82f6;
    font-style: normal;
    margin-right: 5px;
}

.error-icon {
    color: #ff4d4f;
    font-style: normal;
    margin-right: 5px;
}

/* Help Link */
.help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    text-decoration: none;
    margin-left: 5px;
}

.help-link:hover {
    background: #2563eb;
}

/* Form Section */
.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
}

.form-group {
    margin-bottom: 20px;
    padding: 5px 0;
}

/* Form Row Layout */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.row > [class*="col-"] {
    padding: 0 10px;
    position: relative;
}

/* 确保错误提示显示在输入框下方 */
#js-install-form .form-text {
    display: block;
    clear: both;
}

#js-install-form .tips-error {
    margin-top: 5px;
    display: block;
    clear: both;
}

.col-sm-3 {
    width: 25%;
}

.col-sm-6 {
    width: 50%;
}

.col-form-label {
    text-align: right;
    padding-top: 8px;
    font-weight: normal;
    color: #666;
}

/* Form Controls */
.form-control {
    width: 100%;
    height: 36px;
    padding: 6px 12px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    outline: none;
}

.form-control:hover {
    border-color: #3b82f6;
}

/* Input with icon */
.input-with-icon {
    position: relative;
}

.input-with-icon .form-control {
    padding-right: 30px;
}

.input-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: inline-block;
}

.input-icon.success::before {
    content: '✓';
    color: #52c41a;
    font-weight: bold;
    font-size: 16px;
}

.input-icon.error::before {
    content: '✗';
    color: #ff4d4f;
    font-weight: bold;
    font-size: 16px;
}

.input-icon.loading::before {
    content: '⟳';
    color: #3b82f6;
    font-weight: bold;
    font-size: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

select.form-control {
    height: 36px;
    cursor: pointer;
}

textarea.form-control {
    height: auto;
    resize: vertical;
}

.form-text {
    font-size: 12px;
    color: #999;
}

/* Form Validation Styles */
.form-group.has-error .form-control {
    border-color: #ff4d4f;
    background-color: #fff1f0;
}

.form-group.has-error .form-control:focus {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.15);
}

.error-tip {
    display: block;
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 5px;
}

.form-control.is-invalid {
    border-color: #ff4d4f;
}

/* Validation Tips */
.tips-error {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Buttons - Blue Theme */
.btn {
    display: inline-block;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s;
    text-decoration: none;
    background: transparent;
}

.btn-install {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
}

.btn-install:hover {
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #2563eb;
}

.btn-secondary {
    color: #666;
    background-color: #fff;
    border-color: #d9d9d9;
}

.btn-secondary:hover {
    color: #3b82f6;
    border-color: #3b82f6;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: #999;
    font-size: 12px;
}

.footer a {
    color: #999;
    text-decoration: none;
}

.footer a:hover {
    color: #3b82f6;
}

/* Text utilities */
.text-muted {
    color: #999 !important;
}

.text-success {
    color: #52c41a !important;
}

.text-start {
    text-align: left !important;
}

.text-center {
    text-align: center !important;
}

.mt-4 {
    margin-top: 20px !important;
}

.me-2 {
    margin-right: 10px !important;
}

.fw-bold {
    font-weight: 600 !important;
}

.mt-3 {
    margin-top: 15px !important;
}

.mb-4 {
    margin-bottom: 20px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .install-content {
        padding: 20px;
    }

    .step-bar .step-item {
        padding: 0 20px;
    }

    .col-sm-3,
    .col-sm-6 {
        width: 100%;
    }

    .col-form-label {
        text-align: left;
        margin-bottom: 5px;
    }

    .row {
        flex-direction: column;
    }
}
