/* 管理员后台样式 */

/* 登录界面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--system-blue) 0%, var(--system-purple) 100%);
    padding: 20px;
}

.login-card {
    background: var(--system-background);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--elevated-shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 32px;
}

.login-header i {
    font-size: 48px;
    color: var(--system-blue);
    margin-bottom: 16px;
}

.login-header h2 {
    font-family: var(--sf-pro-display);
    font-size: 28px;
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 8px;
}

.login-header p {
    color: #666666 !important;
    font-size: 16px;
}

.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-medium);
    background: var(--system-background);
    color: #000000 !important;
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
}

.form-group textarea {
    height: 80px;
    padding: 12px 16px;
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--system-blue);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888888 !important;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #666666 !important;
}

.login-btn,
.upload-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--system-blue), #0056CC);
    color: white !important;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover,
.upload-btn:hover {
    background: linear-gradient(135deg, #0056CC, var(--system-blue));
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

.login-footer {
    padding-top: 20px;
    border-top: 1px solid var(--separator);
}

.login-footer p {
    font-size: 14px;
    color: #666666 !important;
    margin: 0;
}

/* 管理界面 */
.admin-container {
    padding: 40px 0;
    background: var(--system-grouped-background);
    min-height: calc(100vh - 52px);
}

.admin-header {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
    text-align: center;
}

.admin-header h1 {
    font-family: var(--sf-pro-display);
    font-size: 40px;
    font-weight: 700;
    color: #000000 !important;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.admin-header p {
    font-size: 19px;
    color: #666666 !important;
}

/* 上传区域 */
.upload-section,
.code-section,
.software-list-section {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

/* 表单分区 */
.api-config-section,
.file-upload-section,
.software-info-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--separator);
}

.api-config-section:last-of-type,
.file-upload-section:last-of-type,
.software-info-section:last-of-type {
    border-bottom: none;
}

.api-config-section h4,
.file-upload-section h4,
.software-info-section h4 {
    font-family: var(--sf-pro-display);
    font-size: 18px;
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 文件上传区域 */
.file-upload-area {
    position: relative;
    border: 2px dashed var(--separator);
    border-radius: var(--radius-medium);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--tertiary-system-background);
}

.file-upload-area:hover {
    border-color: var(--system-blue);
    background: rgba(0, 122, 255, 0.05);
}

.file-upload-area.drag-over {
    border-color: var(--system-blue);
    background: rgba(0, 122, 255, 0.1);
    transform: scale(1.02);
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    pointer-events: none;
}

.upload-placeholder i {
    font-size: 48px;
    color: var(--system-blue);
    margin-bottom: 12px;
}

.upload-placeholder p {
    font-size: 16px;
    color: #000000 !important;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-placeholder small {
    color: #666666 !important;
    font-size: 14px;
}

/* 文件信息显示 */
.file-info {
    margin-top: 12px;
    padding: 12px;
    background: var(--system-green);
    color: white;
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-info i {
    font-size: 16px;
}

.file-info .file-details {
    flex: 1;
}

.file-info .file-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.file-info .file-size {
    font-size: 13px;
    opacity: 0.9;
}

.file-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.upload-card,
.code-card,
.software-list-card {
    background: var(--secondary-system-grouped-background);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--card-shadow);
    border: 0.5px solid var(--separator);
}

.upload-card h3,
.code-card h3,
.software-list-card h3 {
    font-family: var(--sf-pro-display);
    font-size: 24px;
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 代码展示区域 */
.code-block {
    position: relative;
    background: #1a1a1a;
    border-radius: var(--radius-medium);
    padding: 20px;
    margin: 16px 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #e1e1e1;
    white-space: pre-wrap;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--system-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #0056CC;
    transform: scale(1.05);
}

.instructions {
    background: var(--tertiary-system-background);
    border-radius: var(--radius-medium);
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid var(--system-blue);
}

.instructions h4 {
    color: #000000 !important;
    font-size: 18px;
    margin-bottom: 12px;
}

.instructions ol {
    color: #444444 !important;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.instructions code {
    background: var(--system-gray6);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--system-pink);
}

/* 当前软件列表 */
.current-software {
    display: grid;
    gap: 16px;
}

.software-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--tertiary-system-background);
    border-radius: var(--radius-medium);
    border: 0.5px solid var(--separator);
}

.software-info-admin {
    display: flex;
    align-items: center;
    gap: 12px;
}

.software-info-admin i {
    font-size: 24px;
    color: var(--system-blue);
}

.software-details h4 {
    font-size: 16px;
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 4px;
}

.software-details p {
    font-size: 14px;
    color: #666666 !important;
    margin: 0;
}

.software-meta-admin {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #888888 !important;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888888 !important;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 成功/错误提示 */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-medium);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert.success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--system-green);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.alert.error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--system-red);
    border: 1px solid rgba(255, 59, 48, 0.3);
}

/* 可视化上传容器 */
.upload-visual-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 16px;
}

.upload-card-visual {
    background: var(--tertiary-system-background);
    border: 2px dashed var(--separator);
    border-radius: var(--radius-large);
    padding: 32px 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-card-visual:hover {
    border-color: var(--system-blue);
    background: rgba(0, 122, 255, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.1);
}

.upload-card-visual.optional {
    border-color: var(--system-orange);
}

.upload-card-visual.optional:hover {
    border-color: var(--system-orange);
    background: rgba(255, 149, 0, 0.03);
}

.upload-icon-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--system-blue), #0056CC);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.2);
}

.upload-card-visual.optional .upload-icon-large {
    background: linear-gradient(135deg, var(--system-orange), #CC7A00);
    box-shadow: 0 8px 24px rgba(255, 149, 0, 0.2);
}

.upload-icon-large i {
    font-size: 36px;
    color: white;
}

.upload-card-visual h5 {
    font-family: var(--sf-pro-display);
    font-size: 20px;
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.optional-label {
    font-size: 14px;
    color: var(--system-orange) !important;
    font-weight: 500;
}

.visual-upload {
    position: relative;
    width: 100%;
    border: none;
    background: none;
    padding: 0;
}

.upload-icon-circle {
    width: 60px;
    height: 60px;
    background: var(--system-blue);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    transition: all 0.3s ease;
}

.upload-icon-circle i {
    font-size: 24px;
    color: white;
}

.visual-upload:hover .upload-icon-circle {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.upload-placeholder h6 {
    font-size: 18px;
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 8px;
}

.upload-placeholder p {
    font-size: 16px;
    color: #666666 !important;
    margin-bottom: 16px;
}

.upload-link {
    color: var(--system-blue) !important;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.supported-formats {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.format-tag {
    background: var(--system-gray6);
    color: var(--label-secondary);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    border: 0.5px solid var(--separator);
}

.visual-file-info {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: var(--system-green);
    color: white;
    padding: 12px;
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
}

.visual-file-info .file-details {
    flex: 1;
}

.visual-file-info .file-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.visual-file-info .file-size {
    font-size: 12px;
    opacity: 0.9;
}

/* 密码修改模态框 */
.password-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.password-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--system-background);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--elevated-shadow);
    width: 90%;
    max-width: 400px;
    border: 0.5px solid var(--separator);
}

.password-modal h3 {
    font-family: var(--sf-pro-display);
    font-size: 24px;
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.password-modal h3 i {
    color: var(--system-blue);
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.password-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.cancel-btn {
    flex: 1;
    height: 44px;
    background: var(--system-gray5);
    color: var(--label-primary);
    border: none;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: var(--system-gray4);
}

.save-btn {
    flex: 1;
    height: 44px;
    background: linear-gradient(135deg, var(--system-blue), #0056CC);
    color: white;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn:hover {
    background: linear-gradient(135deg, #0056CC, var(--system-blue));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .upload-visual-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .upload-card-visual {
        min-height: 280px;
        padding: 24px 16px;
    }
    
    .upload-icon-large {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        margin-bottom: 16px;
    }
    
    .upload-icon-large i {
        font-size: 28px;
    }
    
    .upload-card-visual h5 {
        font-size: 18px;
    }
    
    .password-modal-content {
        padding: 24px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }
    
    .admin-header h1 {
        font-size: 32px;
        flex-direction: column;
        gap: 8px;
    }
    
    .upload-card,
    .code-card,
    .software-list-card {
        padding: 20px;
    }
    
    .software-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .software-meta-admin {
        width: 100%;
        justify-content: space-between;
    }
}